/*
 * JanelaProfessor.java
 *
 * Created on 8 de Abril de 2010, 21:06
 */

package gui;

/**
 *
 * @author  Yuri Maia
 */
public class JanelaProfessor extends javax.swing.JDialog {
    
    /** Creates new form JanelaProfessor */
    public JanelaProfessor(javax.swing.JFrame parent, boolean modal) {
        super(parent, modal);
        initComponents();
        Janelas.alinharContainer(this);
        setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        btnProva = new javax.swing.JButton();
        btnQuestao = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        btnProva.setText("Prova");
        btnProva.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnProvaActionPerformed(evt);
            }
        });

        btnQuestao.setText("Questão");
        btnQuestao.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnQuestaoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(btnProva)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnQuestao)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnProva)
                    .addComponent(btnQuestao))
                .addContainerGap(45, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnProvaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnProvaActionPerformed
        this.setVisible(false);
        JanelaProva janela = new JanelaProva(this);
        janela.setVisible(true);
        this.setVisible(true);
    }//GEN-LAST:event_btnProvaActionPerformed

    private void btnQuestaoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnQuestaoActionPerformed
        this.setVisible(false);
        JanelaQuestao janela = new JanelaQuestao(this, true);
        janela.setVisible(true);
        this.setVisible(true);
    }//GEN-LAST:event_btnQuestaoActionPerformed
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                JanelaProfessor dialog = new JanelaProfessor(new javax.swing.JFrame(), true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }
    
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnProva;
    private javax.swing.JButton btnQuestao;
    // End of variables declaration//GEN-END:variables
    
}
